Skip to content

fix: Suppress spinner on same-route navigation in layout (#3338)#3340

Merged
KATO-Hiro merged 2 commits into
stagingfrom
#3338
Apr 1, 2026
Merged

fix: Suppress spinner on same-route navigation in layout (#3338)#3340
KATO-Hiro merged 2 commits into
stagingfrom
#3338

Conversation

@KATO-Hiro
Copy link
Copy Markdown
Collaborator

@KATO-Hiro KATO-Hiro commented Apr 1, 2026

close #3338

Summary by CodeRabbit

リリースノート

  • バグ修正

    • ナビゲーションスピナーの表示ロジックを改善。同じページ内でのパラメータ変更時にはスピナーが表示されなくなり、ページ間の移動時にのみ表示されるようになりました。
  • ドキュメント

    • 開発ガイドラインを更新し、Svelteコンポーネント構造に関する推奨事項を追加。

KATO-Hiro and others added 2 commits April 1, 2026 11:33
Use $app/state's navigating instead of $app/stores, and limit
spinner display to cross-route navigation by comparing route IDs.
Fixes content flash caused by same-route param changes (e.g. workbooks filters).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2967aa6c-769b-413f-91e2-56945908b482

📥 Commits

Reviewing files that changed from the base of the PR and between 4499569 and 041b2fa.

📒 Files selected for processing (3)
  • .claude/rules/svelte-components.md
  • .claude/rules/sveltekit.md
  • src/routes/+layout.svelte

📝 Walkthrough

Walkthrough

SvelteKit の navigating 状態管理ルールを文書化し、スピナー表示ロジックをクロスルートナビゲーション検出に更新。$app/state から取得した navigating オブジェクトの from プロパティを確認することで、ルート変更を厳密に判定する。

Changes

Cohort / File(s) Summary
ドキュメント更新
.claude/rules/svelte-components.md, .claude/rules/sveltekit.md
Svelte コンポーネント内の条件式リファクタリングおよび SvelteKit の navigating 状態チェック方法に関するルール追加。
ロジック改善
src/routes/+layout.svelte
navigating のインポート元を $app/stores から $app/state に変更。スピナー表示条件を isCrossRouteNavigation() ヘルパーで実装し、同一ルート内のパラメータ変更ではスピナーを非表示に。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

High: ロジック変更の制御フロー確認(navigating.from の null チェックとルート ID 比較)

Low/Info:

  • ドキュメント追加の確認
  • インポート宣言の変更

Poem

✨ ナビゲーションの道しるべ、
クロスルートのみに光る紡ぎ手
同じ道の迷いは消し、
🚀 スムーズな旅へ ✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは PR の主要な変更(同一ルート内ナビゲーション時のスピナー抑制)を正確かつ簡潔に表現しており、変更内容と明確に対応しています。
Linked Issues check ✅ Passed コード変更はリンク済みの issue #3338 の要件「リロードなしで問題集表示」を満たす実装(同一ルート内ナビゲーション時のスピナー抑制)が含まれています。
Out of Scope Changes check ✅ Passed 全ての変更が issue #3338 に対応しており、.claude/rules/ への設定追加、+layout.svelte のスピナー制御ロジック修正は全て scope 内です。
Description check ✅ Passed PR は明確な目的、変更内容の説明、影響範囲が記載されており、ドキュメント更新と実装の両方が含まれています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3338

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro KATO-Hiro merged commit 027f7a0 into staging Apr 1, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3338 branch April 1, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

問題集一覧・区分をリロードなしで表示できるようにしましょう

1 participant